import { createRouter, createWebHashHistory } from 'vue-router';
import layout from "@/views/layout";

const routes = [
    {
        path: '/',
        redirect: '/login',
    },
    {
        path: '/login',
        component: () => import('@/views/login'),
    },
    {
        path: '/deviceManagement',
        component: layout,
        redirect: '/deviceManagement/homePage',
        children: [
            {
                path: 'homePage',
                name: '首页',
                component: () => import('@/views/homePage'),
                meta: {
                    breadcrumb: [{ id: "homePage", text: "首页" }],
                }
            },
            {
                path: 'instrConf',
                component: () => import('@/views/instrConf'),
                meta: {
                    breadcrumb: [{ id: "instrConf", text: "温湿度仪表配置" }],
                }
            },
            {
                path: 'equAlarmRecord',
                component: () => import('@/views/equAlarmRecord'),
                meta: {
                    breadcrumb: [{ id: "equAlarmRecord", text: "设备报警历史记录" }],
                }
            },
            {
                path: 'userView',
                component: () => import('@/views/userView'),
                meta: {
                    breadcrumb: [{ id: "userView", text: "在线用户端查看" }],
                }
            },
            {
                path: 'dataView',
                component: () => import('@/views/dataView'),
                meta: {
                    breadcrumb: [{ id: "dataView", text: "温湿度数据查看" }],
                }
            },
        ]
    },
    
];

const router = createRouter({
    history: createWebHashHistory(),
    routes,
});
export default router;
